home *** CD-ROM | disk | FTP | other *** search
Text File | 2000-03-30 | 1.2 KB | 33 lines | [TEXT/ToyS] |
- -- Save this script as an application and then drop a postscript file on it.
-
-
- on open (theList)
- repeat with afile in theList
- set old_delimits to AppleScript's text item delimiters
- set AppleScript's text item delimiters to ":"
- -- pull the path out as a string and strip off the filename
- set path_text to (afile as text)
- set path_list to (text items of path_text)
- set final_path to items 1 thru ((count of path_list) - 1) of path_list
- set infile to last item of path_list
- set working_directory to (final_path as string) & ":"
- set AppleScript's text item delimiters to "."
- set file_text to (text items of infile)
- set basename to item 1 of file_text
- set AppleScript's text item delimiters to old_delimits
- set outfile to basename & ".txt"
- set command to "gs -q -dNODISPLAY -dNOBIND -dWRITESYSTEMDICT -dSIMPLE -c save -f ps2ascii.ps" & space & infile & " -c quit > " & outfile
- tell application "ps2pdf"
- activate
- set status to (exec command in the folder alias working_directory)
- if status = 0 then
- tell application "Finder"
- set creator type of file (working_directory & outfile) to "ttxt"
- set file type of file (working_directory & outfile) to "TEXT"
- end tell
- quit
- end if
- end tell
- end repeat
- end open
-